import React from "react";
import '../assets/css/footer.css'
function foot(param) { 
  const {ToduList,checkAll,delAll} = param;
  let count = 0
  let done = true && ToduList.length > 0
  ToduList.forEach(item => {
   if(!item.done){
     done = false
   }
    item.done && count++
  });
  return(
    <div className="footer">
      <input type="checkbox" checked={done}  onChange={(e)=>checkAll(e.target.checked)} />全选
      &nbsp;
      &nbsp;
      &nbsp;
      <button onClick={delAll}>删除已完成</button>
      <span style={{margin:'0 0 0 180px'}}>全部：{ToduList.length}/完成：{count}</span>
    </div>
  )
 }
export default foot; // 导出组件